********************************************************************************************************************************************************************************************************************
*************************************************CROATIA************************************************************************************************************************************************************
*************************************************Refrigerators, Freezers, and Washing Machine Program **2015********************************************************************************************************
*************************************************Effects on Unit Sales and Prices of Subsidized and Non-subsidized**************************************************************************************************
********************************************************************************************************************************************************************************************************************

clear all

*log using "R:\WSV2\TBu_BMa\Subsidies Project\Results\HR_Programs_Estimates_2023.smcl", replace

use "Estimation Sample.dta" 


set more off

egen cmt=group(country month treatc)
egen cy =group(country year)
generate 	cat=0
replace 	cat=1 if (category=="freezer"|category=="refrigerator")

encode country, gen(c)
 
xtset id2


preserve

keep if category=="washing machine"
egen median=median(price) if year==2015 & treatc==1 & month==4
gen mprice=1 if price>median & treatc==1 & year==2015 & month==4 & price!=.
replace mprice=0 if price<=median & treatc==1 & year==2015 & month==4 & price!=.
by id, sort: egen summp=sum(mprice)
by id, sort: gen medprice=1 if summp>0
replace medprice=0 if summp==0
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
***UNIT SALES, SUBSIDIZED, WASHING MACHINES

reghdfe dlogunits i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc  i.postsub7c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)
est store subu
gen samples=e(sample)
codebook id if samples
codebook id if samples & treatc==1

		
		***Program, preshift and postshift effects (June, two pre-subsidy months, one post-subsidy month)
		#delimit;
		nlcom 		(program:  	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])-1)) 
					(preshift: 	1/2*(exp(_b[1.presub1c])*(1+exp(_b[1.presub2c]))-2))
					(postshift:	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])-1)), post;			
		#delimit	cr		
		
		***Net program effect, June
		nlcom 		_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift]
		
		***Program cost, June
		nlcom 		1000*600468/((_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift])*2314.257*14*99.07), level(90)
		
		***Program cost, June (25th percentile)
		nlcom 		1000*600468/((_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift])*2314.257*14*113.1), level(90)
		
		***Program cost, June (10th percentile)
		nlcom 		1000*600468/((_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift])*2314.257*14*125.1), level(90)
		
		***Energy savings, June
		nlcom 		((_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift])*2314.257*14*99.07)/1000, level(90)

		
		
reghdfe dlogunits i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc  i.postsub7c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)		
		
		
		***Program, preshift and postshift effects (October, two pre-subsidy months, two post-subsidy months)                                                                                                                                             

		#delimit;
		nlcom 		(program:  	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])-1))
					(preshift: 	1/2*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*(1+exp(_b[1.postsub3c]))-2))
					(postshift:	1/2*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])*exp(_b[1.postsub5c])*(1+exp(_b[1.postsub6c]))-2)), post;			
		#delimit	cr		
		
		***Net program effect, October
		nlcom 		_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift]	 
		
		***Program cost, October
		nlcom 		1000*634707/((_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift])*2825.515*14*99.07)
		
		***Program cost, October (25th percentile)
		nlcom 		1000*634707/((_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift])*2825.515*14*113.1)
		
		***Program cost, October (10th percentile)
		nlcom 		1000*634707/((_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift])*2825.515*14*125.1)
		
		***Energy savings, October
		nlcom 		((_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift])*2825.515*14*99.07)/1000
		
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
***UNIT SALES, SUBSIDIZED, WASHING MACHINES, CY-fe

reghdfe dlogunits i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc  i.postsub7c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt cy) cluster(id)
est store subu_cy		


		***Program, preshift and postshift effects (June, two pre-subsidy months, one post-subsidy month)
		#delimit;
		nlcom 		(program:  	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])-1)) 
					(preshift: 	1/2*(exp(_b[1.presub1c])*(1+exp(_b[1.presub2c]))-2))
					(postshift:	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])-1)), post;			
		#delimit	cr		
		
		***Net program effect, June
		nlcom 		_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift]
		
		***Program cost, June
		nlcom 		1000*600468/((_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift])*2314.257*14*99.07), level(90)
		
		***Energy savings, June
		nlcom 		((_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift])*2314.257*14*99.07)/1000, level(90)
		
reghdfe dlogunits i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc  i.postsub7c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt cy) cluster(id)		


		***Program, preshift and postshift effects (October, two pre-subsidy months, two post-subsidy months)                                                                                                                                             

		#delimit;
		nlcom 		(program:  	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])-1))
					(preshift: 	1/2*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*(1+exp(_b[1.postsub3c]))-2))
					(postshift:	1/2*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])*exp(_b[1.postsub5c])*(1+exp(_b[1.postsub6c]))-2)), post;			
		#delimit	cr		
		
		***Net program effect, October
		nlcom 		_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift]	 
		
		***Program cost, October
		nlcom 		1000*634707/((_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift])*2825.515*14*99.07)
		
		***Energy savings, October
		nlcom 		((_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift])*2825.515*14*99.07)/1000
		
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
***UNIT SALES, SUBSIDIZED, WASHING MACHINES, Country-specific linear date trends
reghdfe dlogunits i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc  i.postsub7c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt i.c#c.date) cluster(id)
est store subu_trends		


		***Program, preshift and postshift effects (June, two pre-subsidy months, one post-subsidy month)
		#delimit;
		nlcom 		(program:  	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])-1)) 
					(preshift: 	1/2*(exp(_b[1.presub1c])*(1+exp(_b[1.presub2c]))-2))
					(postshift:	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])-1)), post;			
		#delimit	cr		
		
		***Net program effect, June
		nlcom 		_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift]
		
		***Program cost, June
		nlcom 		1000*600468/((_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift])*2314.257*14*99.07), level(90)
		
		***Energy savings, June
		nlcom 		((_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift])*2314.257*14*99.07)/1000, level(90)
		
reghdfe dlogunits i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc  i.postsub7c##ib1.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt i.c#c.date) cluster(id)		


		***Program, preshift and postshift effects (October, two pre-subsidy months, two post-subsidy months)                                                                                                                                             

		#delimit;
		nlcom 		(program:  	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])-1))
					(preshift: 	1/2*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*(1+exp(_b[1.postsub3c]))-2))
					(postshift:	1/2*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])*exp(_b[1.postsub5c])*(1+exp(_b[1.postsub6c]))-2)), post;			
		#delimit	cr		
		
		***Net program effect, October
		nlcom 		_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift]	 
		
		***Program cost, October
		nlcom 		1000*634707/((_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift])*2825.515*14*99.07)
		
		***Energy savings, October
		nlcom 		((_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift])*2825.515*14*99.07)/1000
		
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	
***UNIT SALES, SUBSIDIZED (response above and below price median)

reghdfe dlogunits i.presub3c##ib1.treatc##ib1.medprice i.presub2c##ib1.treatc##ib1.medprice i.presub1c##ib1.treatc##ib1.medprice i.sub1c##ib1.treatc##ib1.medprice i.postsub1c##ib1.treatc##ib1.medprice i.postsub2c##ib1.treatc##ib1.medprice i.postsub3c##ib1.treatc##ib1.medprice i.postsub4c##ib1.treatc##ib1.medprice i.postsub5c##ib1.treatc##ib1.medprice i.postsub6c##ib1.treatc##ib1.medprice  i.postsub7c##ib1.treatc##ib1.medprice mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)
est store subu_above

reghdfe dlogunits i.presub3c##ib1.treatc##ib0.medprice i.presub2c##ib1.treatc##ib0.medprice i.presub1c##ib1.treatc##ib0.medprice i.sub1c##ib1.treatc##ib0.medprice i.postsub1c##ib1.treatc##ib0.medprice i.postsub2c##ib1.treatc##ib0.medprice i.postsub3c##ib1.treatc##ib0.medprice i.postsub4c##ib1.treatc##ib0.medprice i.postsub5c##ib1.treatc##ib0.medprice i.postsub6c##ib1.treatc##ib0.medprice  i.postsub7c##ib1.treatc##ib0.medprice mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)
est store subu_below

esttab   subu subu_above subu_below , se star(* 0.10 ** 0.05 *** 0.01) mtitles nogaps b(%8.3f) t(%6.2f)  scalars(N ) order(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) keep(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) 

esttab   subu subu_above subu_below  using "HR_15_medianprice.tex" ,replace  se nostar mtitles nogaps b(%8.3f) t(%6.2f)  scalars(N ) order(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) keep(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) 		
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		
***UNIT SALES, NON-SUBSIDIZED
reghdfe dlogunits i.presub3c##i.treatc i.presub2c##i.treatc i.presub1c##i.treatc i.sub1c##i.treatc i.postsub1c##i.treatc i.postsub2c##i.treatc i.postsub3c##i.treatc i.postsub4c##i.treatc i.postsub5c##i.treatc i.postsub6c##i.treatc i.postsub7c##i.treatc mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)
est store nonsubu

	
		***Program, preshift and postshift effects (June, two pre-subsidy months, one post-subsidy month)
		#delimit;
		nlcom 		(program:  	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])-1)) 
					(preshift: 	1/2*(exp(_b[1.presub1c])*(1+exp(_b[1.presub2c]))-2))
					(postshift:	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])-1)), post;			
		#delimit	cr		
		
		***Net program effect, June
		nlcom 		_b[program] + (2/1)*_b[preshift]+ (1/1)*_b[postshift]
		

		
reghdfe dlogunits i.presub3c##i.treatc i.presub2c##i.treatc i.presub1c##i.treatc i.sub1c##i.treatc i.postsub1c##i.treatc i.postsub2c##i.treatc i.postsub3c##i.treatc i.postsub4c##i.treatc i.postsub5c##i.treatc i.postsub6c##i.treatc i.postsub7c##i.treatc  mage mage2  if country!="Hungary" , absorb (id2 cmt) cluster(id)		

		***Program, preshift and postshift effects (October, two pre-subsidy months, two post-subsidy months)                                                                                                                                             

		#delimit;
		nlcom 		(program:  	1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])-1))
					(preshift: 	1/2*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*(1+exp(_b[1.postsub3c]))-2))
					(postshift:	1/2*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])*exp(_b[1.postsub5c])*(1+exp(_b[1.postsub6c]))-2)), post;			
		#delimit	cr		
		
		***Net program effect, October
		nlcom 		_b[program] + (2/1)*_b[preshift]+ (2/1)*_b[postshift]	 
		

      
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		
***PRICES, SUBSIDIZED
reghdfe dlogprice i.presub3c##ib1.treatc i.presub2c##ib1.treatc i.presub1c##ib1.treatc i.sub1c##ib1.treatc i.postsub1c##ib1.treatc i.postsub2c##ib1.treatc i.postsub3c##ib1.treatc i.postsub4c##ib1.treatc i.postsub5c##ib1.treatc i.postsub6c##ib1.treatc i.postsub7c##ib1.treatc  mage mage2  if country!="Hungary" & samples , absorb (id2 cmt) cluster(id)
est store subp

		nlcom 		1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])-1)

		nlcom 		1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])-1)

	

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

***PRICES, NON-SUBSIDIZED
reghdfe dlogprice i.presub3c##i.treatc i.presub2c##i.treatc i.presub1c##i.treatc i.sub1c##i.treatc i.postsub1c##i.treatc i.postsub2c##i.treatc i.postsub3c##i.treatc i.postsub4c##i.treatc i.postsub5c##i.treatc i.postsub6c##i.treatc i.postsub7c##i.treatc  mage mage2  if country!="Hungary"  & samples, absorb (id2 cmt) cluster(id)
est store nonsubp

		nlcom 		1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])-1)

		nlcom 		1*(exp(_b[1.presub2c])*exp(_b[1.presub1c])*exp(_b[1.sub1c])*exp(_b[1.postsub1c])*exp(_b[1.postsub2c])*exp(_b[1.postsub3c])*exp(_b[1.postsub4c])-1)

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
***TABLES

**UNITS AND PRICES
esttab   subu nonsubu  subp nonsubp , se star(* 0.10 ** 0.05 *** 0.01) mtitles nogaps b(%8.3f) t(%6.2f)  scalars(N ) order(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) keep(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) 

esttab   subu nonsubu  subp nonsubp  using "HR_15.tex" ,replace  se nostar mtitles nogaps b(%8.3f) t(%6.2f)  scalars(N ) order(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) keep(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) 

esttab   subu_cy subu_trends,  se star(* 0.10 ** 0.05 *** 0.01) mtitles nogaps b(%8.3f) t(%6.2f)  scalars(N ) order(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) keep(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) 

esttab   subu_cy subu_trends  using "HR_15_cy.tex" ,replace  se nostar mtitles nogaps b(%8.3f) t(%6.2f)  scalars(N ) order(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) keep(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) 
		
restore 
		
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
***RESPONSE BY SUBSIDIZED CATEGORY

egen cmtc=group(country month treatc cat)

***WASHING MACHINES, UNIT SALES, SUBSIDIZED

reghdfe dlogunits i.presub3c##ib1.treatc##ib0.cat i.presub2c##ib1.treatc##ib0.cat i.presub1c##ib1.treatc##ib0.cat i.sub1c##ib1.treatc##ib0.cat i.postsub1c##ib1.treatc##ib0.cat i.postsub2c##ib1.treatc##ib0.cat i.postsub3c##ib1.treatc##ib0.cat i.postsub4c##ib1.treatc##ib0.cat i.postsub5c##ib1.treatc##ib0.cat i.postsub6c##ib1.treatc##ib0.cat i.postsub7c##ib1.treatc##ib0.cat  mage mage2  if country!="Hungary" , absorb (id2 cmtc) cluster(id)
est store subwmu
gen samplew=e(sample)
codebook id if samplew
codebook id if samplew & treatc==1
		
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++		
***REFRIGERATORS AND FREEZERS, UNIT SALES, SUBSIDIZED

reghdfe dlogunits i.presub3c##ib1.treatc##ib1.cat i.presub2c##ib1.treatc##ib1.cat i.presub1c##ib1.treatc##ib1.cat i.sub1c##ib1.treatc##ib1.cat i.postsub1c##ib1.treatc##ib1.cat i.postsub2c##ib1.treatc##ib1.cat i.postsub3c##ib1.treatc##ib1.cat i.postsub4c##ib1.treatc##ib1.cat i.postsub5c##ib1.treatc##ib1.cat i.postsub6c##ib1.treatc##ib1.cat i.postsub7c##ib1.treatc##ib1.cat  mage mage2  if country!="Hungary" , absorb (id2 cmtc) cluster(id)
est store subffu
		
		
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++	
***WASHING MACHINES, PRICES, SUBSIDIZED

reghdfe dlogprice i.presub3c##ib1.treatc##ib0.cat i.presub2c##ib1.treatc##ib0.cat i.presub1c##ib1.treatc##ib0.cat i.sub1c##ib1.treatc##ib0.cat i.postsub1c##ib1.treatc##ib0.cat i.postsub2c##ib1.treatc##ib0.cat i.postsub3c##ib1.treatc##ib0.cat i.postsub4c##ib1.treatc##ib0.cat i.postsub5c##ib1.treatc##ib0.cat i.postsub6c##ib1.treatc##ib0.cat i.postsub7c##ib1.treatc##ib0.cat  mage mage2  if country!="Hungary" & samplew , absorb (id2 cmtc) cluster(id)
est store subwmp
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++		
***REFRIGERATORS AND FREEZERS, PRICES, SUBSIDIZED

reghdfe dlogprice i.presub3c##ib1.treatc##ib1.cat i.presub2c##ib1.treatc##ib1.cat i.presub1c##ib1.treatc##ib1.cat i.sub1c##ib1.treatc##ib1.cat i.postsub1c##ib1.treatc##ib1.cat i.postsub2c##ib1.treatc##ib1.cat i.postsub3c##ib1.treatc##ib1.cat i.postsub4c##ib1.treatc##ib1.cat i.postsub5c##ib1.treatc##ib1.cat i.postsub6c##ib1.treatc##ib1.cat  i.postsub7c##ib1.treatc##ib1.cat mage mage2  if country!="Hungary"  & samplew, absorb (id2 cmtc) cluster(id)
		est store subffp
		

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
***TABLES		

**UNITS AND PRICES BY CATEGORY
esttab subwmu subffu    subwmp subffp, se star(* 0.10 ** 0.05 *** 0.01) mtitles nogaps b(%8.3f) t(%6.2f)  scalars(N ) order(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) keep(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) 

esttab   subwmu subffu    subwmp subffp  using "HR_15_cat.tex", replace  se nostar mtitles nogaps b(%8.3f) t(%6.2f)  scalars(N ) order(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) keep(1.presub3c 1.presub2c 1.presub1c 1.sub1c 1.postsub1c 1.postsub2c 1.postsub3c 1.postsub4c 1.postsub5c 1.postsub6c 1.postsub7c) 


*log close
